package singleton;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONUtil;

import java.io.File;
import java.nio.charset.StandardCharsets;

/**
 * @Author: 582895699@qq.com
 * @Desctription: TODO
 * @Date: Created in 2021/12/7 22:22
 */
public enum SingletonFive {
    /**
     * 实例
     */
    INSTANCE;

    public JSONArray getArray() {
        String string = FileUtil.readString(new File("F:\\fx.json"), StandardCharsets.UTF_8);
        return JSONUtil.parseArray(string);
    }

    public static void main(String[] args) {
        ThreadUtil.concurrencyTest(100, () -> {
            final JSONArray array = SingletonFive.INSTANCE.getArray();
            System.out.println(array.size());
        });
    }
}
